import pandas as pd
from pitchSrc.tools.fusionDecorator import FusionDecorator
from common.config import pitchConfig as Config

from pitchSrc.tools.loadFile import toAttrCsv, toCsv
from pitchSrc.tools.groupDecorator import GroupDecorator



@FusionDecorator.fusion2
def onlFusionProcess(X):
    print('online fusionProcess 进行中................')
    return X

@GroupDecorator.formulate
def fusionGroupProcess(X):
    print('groupProcess 进行中................')
    return X

def fusionToCsv(from1, from2, to3, funtionName):
    X1 = pd.read_csv(from1)
    X2 = pd.read_csv(from2)
    X3 = funtionName(X1, X2)
    X3.to_csv(to3, index=False)
    print('toCsv 完毕................')

def fusionProcess():
    fusionToCsv(Config.onlSurfaceProcess
                , Config.onlSmoothProcess
                , Config.onlFusionProcess
                , onlFusionProcess)
    # toCsv(Config.onlFusionProcess, Config.onlFusionProcess, fusionGroupProcess)
    toAttrCsv(Config.onlFusionProcess, Config.onlFusionAttr)
    print('onlilne fusionProcess 完毕................')
    # show3dFig(Config.onlFusionProcess)
if __name__ == '__main__':

    fusionProcess()
